#include "LPFComputator.h"
#include "Helper.h"

void LPFComputatorTest() {
	LPFComputator filter(44000, 12000, 16000, 0.001, 0.001, LPFComputator::convolutionMethodType::NORMAL_CPU);
	
	int M;
	int N;
	N=filter.getSizeOfImpulseResponse();
	M=(N-1)/2;
    
    float_type* h=new float_type[N];
	filter.getImpulseResponse(h);
	printArray(h, filter.getSizeOfImpulseResponse(), true, "h.txt");
    
	float_type** x = NULL, **y = NULL;
    x[0] = new float_type[200];
    y[0] = new float_type[200];
    
	for(int i=0; i<200; ++i) x[0][i]=10;
	for(int i=0; i<100; ++i) x[0][2*i]=10;
    
    x[0][30]=x[0][90]=100;
	
	filter.process(x, y, 200, 1);
    
	printArray ( x[0]+M, 160, true, "x.txt");
	printArray ( y[0]+2*M, 160, true, "y.txt");
    
	delete [] h;
}


